package site.wenneng.dev.objs.dto.dic;

import lombok.Data;
import site.wenneng.dev.objs.po.DictionaryTypePO;

import java.util.ArrayList;
import java.util.List;

@Data
public class DictionaryTreeNodeDTO {
    private Integer id;
    private String code;
    private String name;
    private Integer parentId;
    private List<DictionaryTreeNodeDTO> children;

    public DictionaryTreeNodeDTO(DictionaryTypePO dictionaryTypePO) {
        this.id = dictionaryTypePO.getId();
        this.code = dictionaryTypePO.getCode();
        this.name = dictionaryTypePO.getName();
        this.parentId = dictionaryTypePO.getParentId();
        this.children = new ArrayList<>();
    }
}
